<template>
    <div>
        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="username">
                <el-input v-model="form.username"></el-input>
            </el-form-item>
            <el-form-item label="password">
                <el-input v-model="form.password"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSubmit">立即创建</el-button>
                <el-button>取消</el-button>
            </el-form-item>
        </el-form>

    </div>
</template>
<script>
    import {login} from '../api/index'

    export default {
        data() {
            return {
                form: {
                    username: '',
                    password: ''
                }
            }
        },
        created() {

        },
        methods: {
            onSubmit() {
                login(this.form).then(res => {
                    console.info(res)
                }).catch(error => {
                    console.info(error)
                })
            }
        }
    }
</script>
